package com.lanou.controller;

import com.lanou.bean.Student;
import com.lanou.service.StudentService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by lizhongren1.
 */
@Controller
public class MainController {

    @Resource
    private StudentService studentService;

    @RequestMapping(value = "/home")
    public String homePage(){
        return "home";
    }

    @ResponseBody
    @RequestMapping(value = "/getall")
    public List<Student> allStu(){

        return studentService.findAllStu();
    }


    //new
    @RequestMapping(value = "/new")
    public String newPage(){

        return "newpage";
    }




}
